// const shell = require('shelljs')
// shell.exec('vue-cli-service serve')


// const { spawn  } = require('child_process');
// const child = spawn('vue-cli-service serve');
// child.stdout.on('data', (data) => {
//   process.stdout.write(data); // 实时输出到控制台
// });
// child.stderr.on('data', (data) => {
//   console.error(`错误: ${data}`);
// });

const { spawn } = require('child_process');
 
const child = spawn('vue-cli-service serve', {
  shell: true,
  stdio: 'inherit'
});
 
child.on('error', (err) => {
  console.error('Failed to start Vue CLI:', err);
});
 
child.on('close', (code) => {
  console.log(`子进程退出，退出码: ${code}`);
});